<?php
/*
 * To get this to work, activate Titan Framework Plugin
 */

$theme_admin_page = TitanFramework::getInstance('larch');
//Create Admin Page
$admin_panel = $theme_admin_page->createAdminPanel(
		array(
			'name'=>__('R. Dan Admin Options','larch'),
			'title'=>__('R. Dan Admin Options','larch'),
			'id'=>'larch_admin_panel',
			'icon'=> get_template_directory_uri().'/assets/img/screen.png'
		)
);
/*Create Admin Sections*/
$general_settings = $admin_panel->createTab(
		array(
			'name'=>__('General Settings','larch'),
			'title'=>__('General Settings','larch'),
			'id'=>'larch_general_settings'
		)
);
$header_settings = $admin_panel->createTab(
		array(
			'name'=>__('Header Settings','larch'),
			'title'=>__('Header Settings','larch'),
			'id'=>'larch_header_settings'
		)
);
$content_settings = $admin_panel->createTab(
		array(
			'name'=>__('Content Settings','larch'),
			'title'=>__('Content Settings','larch'),
			'id'=>'larch_content_settings'
		)
);
$footer_settings = $admin_panel->createTab(
		array(
			'name'=>__('Footer Settings','larch'),
			'title'=>__('Footer Settings','larch'),
			'id'=>'larch_footer_settings'
		)
);
$social_settings = $admin_panel->createTab(
		array(
			'name'=>__('Social Settings','larch'),
			'title'=>__('Social Settings','larch'),
			'id'=>'larch_social_settings'
		)
);
$seo_settings = $admin_panel->createTab(
		array(
			'name'=>__('Search Engine Settings','larch'),
			'title'=>__('Search Engine Settings','larch'),
			'id'=>'larch_seo_settings'
		)
);
/*Create Section Fields
 * 
 * Header Section Fields
 */
$header_settings->createOption( array(
    'name' => 'Logo',
    'id' => 'header_logo',
    'type' => 'upload',
    'desc' => 'choose image'
) );
$header_settings->createOption( array(
    'name' => 'Header Banner',
    'id' => 'header_banner',
    'options' => array(
        '1' => 'None',
        '2' => 'Image',
        '3' => 'Slider',
    ),
    'type' => 'radio',
    'desc' => 'Select one',
    'default' => '2',
) );
$header_settings->createOption( array(
    'name' => 'Banner Image',
    'id' => 'header_banner_image',
    'type' => 'upload',
    'desc' => 'choose banner image'
) );
$header_settings->createOption( array(
    'name' => 'Navigation Link Color',
    'id' => 'header_nav_font_color',
    'type' => 'color',
    'desc' => 'Pick a color',
    'default' => '#666666',
) );
$header_settings->createOption(
	array(
		'name'=>'Company Details',
		'type'=>'checkbox',
		'id'=>'show_company_details',
		'desc'=>'show',
		'default'=>true,
	)
);
$header_settings->createOption(
	array(
		'name'=>'Company Address',
		'type'=>'textarea',
		'id'=>'larch_company_address',
		'placeholder'=>'Pasig City',
		'default'=>'Pasig City',
	)
);
$header_settings->createOption(
	array(
		'name'=>'Company Email Addrees',
		'type'=>'text',
		'id'=>'larch_email_address',
		'placeholder'=>'@robertdan.com.ph',
		'default'=>'@robertdan.com.ph',
	)
);
$header_settings->createOption(
	array(
		'name'=>'Company Landline',
		'type'=>'text',
		'id'=>'larch_landline',
		'placeholder'=>'1234567',
		'default'=>'1234567',
	)
);
$header_settings->createOption( array(
    'name' => 'Background Color',
    'id' => 'header_background_color',
    'type' => 'color',
    'desc' => 'Pick a color',
    'default' => '#555555',
) );
$header_settings->createOption(
	array(
		'name'=>'Use Background Image',
		'type'=>'checkbox',
		'id'=>'larch_use_header_bg_image',
		'desc'=>'use',
		'default'=>false,
	)
);
$header_settings->createOption( array(
    'name' => 'Background Image',
    'id' => 'header_background_image',
    'type' => 'upload',
    'desc' => 'choose image'
) );
$header_settings->createOption( array(
    'name' => 'Background Size',
    'id' => 'header_bg_layout',
    'type' => 'select',
    'desc' => '',
    'options' => array(
        '1' => 'Screen Wide',
        '2' => 'Boxed',
    ),
    'default' => '1',
) );
/* End Header Fields
 * 
 * General Settings Fields
 */
$general_settings->createOption( array(
    'name' => 'Header Font',
    'id' => 'general_header_font',
    'type' => 'select-googlefont',
    'default' => array(
        'name' => 'Exo',
        'variants' => array( '400', 'italic' ),
        'subsets' => array( 'latin-ext' )
    )
) );
$general_settings->createOption(array(
	'name'=>'Header Font Size',
	'id'=>'general_header_font_size',
	'type'=>'text',
	'default'=>'12',
	'desc'=>'px'
));
$general_settings->createOption( array(
    'name' => 'Header Font Color',
    'id' => 'general_header_font_color',
    'type' => 'color',
    'desc' => 'Pick a color',
    'default' => '#555555',
) );
$general_settings->createOption( array(
    'name' => 'Content Font',
    'id' => 'general_content_font',
    'type' => 'select-googlefont',
    'default' => array(
        'name' => 'Exo',
        'variants' => array( '400', 'italic' ),
        'subsets' => array( 'latin-ext' )
    )
) );
$general_settings->createOption( array(
    'name' => 'Content Font Color',
    'id' => 'general_content_font_color',
    'type' => 'color',
    'desc' => 'Pick a color',
    'default' => '#555555',
) );
$general_settings->createOption(array(
	'name'=>'Content Font Size',
	'id'=>'general_content_font_size',
	'type'=>'text',
	'default'=>'12',
	'desc'=>'px'
));
$general_settings->createOption( array(
    'name' => 'Footer Font',
    'id' => 'general_footer_font',
    'type' => 'select-googlefont',
    'default' => array(
        'name' => 'Exo',
        'variants' => array( '400', 'italic' ),
        'subsets' => array( 'latin-ext' )
    )
) );
/* End General Fields
 * 
 * Footer Section Fields
 */
$footer_settings->createOption(
	array(
		'name'=>'Use Footer Background Pattern',
		'type'=>'checkbox',
		'id'=>'footer_enable_background',
		'desc'=>'show',
		'default'=>false,
	)
);
$footer_settings->createOption( array(
    'name' => 'Footer Background Pattern',
    'id' => 'footer_enable_background_pattern',
    'type' => 'upload',
    'desc' => 'choose image'
) );
/* End Footer Fields
 * 
 * Social Media Section Fields
 */
$social_settings->createOption( array(
    'name' => 'Facebook Icon',
    'id' => 'social_fb_icon',
    'type' => 'upload',
    'desc' => 'choose image',
	'default'=>  get_template_directory_uri().'/assets/img/facebook.png'
) );
$social_settings->createOption(array(
	'name'=>'Facebook Url',
	'id'=>'social_fb_url',
	'type'=>'text',
	'default'=>'www.facebook.com/yourpage',
));
$social_settings->createOption( array(
    'name' => 'Twitter Icon',
    'id' => 'social_tw_icon',
    'type' => 'upload',
    'desc' => 'choose image',
	'default'=>  get_template_directory_uri().'/assets/img/twitter.png'
) );
$social_settings->createOption(array(
	'name'=>'Twitter Url',
	'id'=>'social_tw_url',
	'type'=>'text',
	'default'=>'www.twitter.com/yourpage',
));
/* End Social Media Fields
 * 
 * Content Section Fields
 */
$content_settings->createOption( array(
    'name' => 'Front Page Content',
    'id' => 'content_frontpage',
    'type' => 'multicheck',
    'desc' => 'Check what you want to see in the front page',
    'options' => array(
        'services' => 'Services',
        'download' => 'Products "Download Brochure"',
        'partners' => 'Partners',
    ),
    'default' => array( 'services','download', 'partners' ),
) );
//THE SAVE BUTTON
$admin_panel->createOption(array(
	'type'=>'Save'
));
function get_theme_options(){
	$titan = TitanFramework::getInstance('larch');
	$GLOBALS['titan_theme_options'] = $titan->getAllOptions();
}
add_action('get_theme_options','get_theme_options');